package net.organizer.ui.actionhandler.message;

import org.json.*;

public class ActionHandlerMessage {

//--------------------------------------------------------------------------------------------------

public ActionHandlerMessage(final EActionHandlerMessageType actionHandlerMessageType,
                            final JSONObject jsonObject, final Object... pars) {
  try {
    JSONObject messageJSONObject = new JSONObject();
    for (int parIndex = 0; parIndex < pars.length - 1; parIndex += 2) {
      messageJSONObject.put("" + pars[parIndex], pars[parIndex + 1]);
    }
    jsonObject.put(actionHandlerMessageType.getMessageString(), messageJSONObject);
  }
  catch (JSONException e) {
    throw new RuntimeException(e);
  }
} // ActionHandlerMessage()

//--------------------------------------------------------------------------------------------------

}